<%@ page contentType="text/html;charset=utf-8" language="java" import="java.sql.*"%>
<jsp:useBean id="dbConnection" scope="page" class="DB.DBConnection"/>
<script>
<%	String user=(String)session.getAttribute("username");
	dbConnection.getConnection();
  	String sql="select * from usr_info where usr_name='"+user+"'";
  	ResultSet rs=dbConnection.executeQuery(sql);
	while(rs.next()){
	if(rs.getInt("usr_root")==0){
%>	alert("您不是管理员，请继续聊天^_^");
	window.navigate("/209ChatRoom/chat/main.jsp");
<%}else{
%>
  	window.navigate("/209ChatRoom/admin.jsp");	
<%}	}dbConnection.closeConn();
%>
</script>